/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package adcon.negocio.advogado;

import adcon.negocio.dados.Endereco;
import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;

/**
 *
 * @author Administrador
 */
@Entity
public class Advogado implements Serializable {
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE)
    private int codigo;
    private String nome;
    @OneToOne(cascade=CascadeType.ALL)
    private Endereco endereco = new Endereco();
  

    public Advogado() {
    }
   
   public int getCodigo() {
        return codigo;
    }

   public void setCodigo(int codigo) {
        this.codigo = codigo;
    }

    public Endereco getEndereco() {
        return endereco;
    }

    public void setEndereco(Endereco endereco) {
        this.endereco = endereco;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    @Override
    public String toString(){
        return nome;
    }

  
    
}
